package cn.cleanarch.infra.idp.s3.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import cn.cleanarch.infra.idp.database.entity.DBModel;
import org.hibernate.validator.constraints.Length;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * S3配置实体类
 */
@Data
@ToString
@EqualsAndHashCode(callSuper = true)
@TableName("t_s3_config")
public class S3Config extends DBModel {

    /**
     * 配置名称
     */
    @Length(max = 100)
    private String name;

    /**
     * 业务类型
     */
    @Length(max = 50)
    private String businessType;

    /**
     * S3端点
     */
    @Length(max = 200)
    private String endpoint;

    /**
     * 访问密钥
     */
    @Length(max = 200)
    private String accessKey;

    /**
     * 私密密钥
     */
    @Length(max = 200)
    private String secretKey;

    /**
     * 存储桶名称
     */
    @Length(max = 100)
    private String bucket;

    /**
     * 区域
     */
    @Length(max = 50)
    private String region;

    /**
     * 描述
     */
    @Length(max = 500)
    private String description;

    /**
     * 是否启用
     */
    private Boolean enabled;

    /**
     * 基础路径
     */
    @TableField(value = "base_path", insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
    @Length(max = 200)
    private String basePath;

    /**
     * 是否使用路径风格访问（path-style access）
     * true: 使用路径风格 (https://s3.amazonaws.com/bucket/key)
     * false: 使用虚拟主机风格 (https://bucket.s3.amazonaws.com/key)
     */
    @TableField(value = "path_style")
    private Boolean pathStyle;

    /**
     * 创建者ID
     */
    @TableField("create_by")
    private Long createBy;

    /**
     * 更新者ID
     */
    @TableField("update_by")
    private Long updateBy;

    public Boolean getPathStyle() {
        return pathStyle;
    }

    public void setPathStyle(Boolean pathStyle) {
        this.pathStyle = pathStyle;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }
}